package com.example.boss.pinkdiary;

import com.example.boss.db.gen.diaryPwd;
import com.example.boss.db.gen.diaryPwdDao;

import java.util.List;

/**
 * Created by 打好boss on 2018/6/18.
 */

public class diaryPwdDaoHelper {
    static private diaryPwdDao dpd;
    public diaryPwdDaoHelper(diaryPwdDao dpd){
        this.dpd=dpd;
    }
    public int selectPwd(String pwd){
        Long num=dpd.queryBuilder().where(diaryPwdDao.Properties.Pwd.eq(pwd)).count();
        if(num==0){
            return 0;
        }
        else return 1;
    }
    public Long selectNUm(){
        return dpd.queryBuilder().count();
    }

}
